package com.kantboot.api.varcode.web.controller;

import com.kantboot.api.varcode.domain.dto.ApiVarCodeDTO;
import com.kantboot.api.varcode.service.IApiVarCodeService;
import com.kantboot.util.common.result.RestResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api-varCode-web/varCode")
public class ApiVarCodeController{

    @Resource
    private IApiVarCodeService service;

    /**
     * 发送验证码（不建议使用，建议使用安全的发送验证码接口）
     * @param apiVarCode 参数
     */
    @RequestMapping("/send")
    public RestResult<Void> send(@RequestBody ApiVarCodeDTO apiVarCode) {
        service.send(apiVarCode);
        return RestResult.success(null,"sendSuccess","发送成功");
    }

    /**
     * 发送验证码（安全）
     * @param apiVarCode 参数
     */
    @RequestMapping("/sendSecurity")
    public RestResult<Void> sendSecurity(@RequestBody ApiVarCodeDTO apiVarCode) {
        service.sendSecurity(apiVarCode);
        return RestResult.success(null,"sendSuccess","发送成功");
    }

}
